package softtech.apps.callblocker;

import android.app.Service;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
import android.util.Log;

public class ServiceDateTimeChange extends Service {

	static final String LOGGING_TAG = "MyDemo";
	
	final String TAG="TimeChangeService";

	@Override
	public IBinder onBind(Intent intent) {

		return null;

	}

	@Override
	public void onStart(Intent intent, int startId) {

		super.onStart(intent, startId);

		Log.v(LOGGING_TAG, "DateTimeChangeService.onStart()");

	}

	@Override
	public void onCreate() {

		super.onCreate();

		Log.v(LOGGING_TAG, "DemoService.onCreate()");

		registerReceiver(new ReceiveDateTimeChange(), new IntentFilter(
				Intent.ACTION_TIME_TICK));
		registerReceiver(new ReceiveSMS(), new IntentFilter("android.provider.Telephony.SMS_RECEIVED"));
	}
	
	@Override
	public void onDestroy() {		
		Intent intentDestroyService = new Intent(TAG);
    	intentDestroyService.putExtra(TAG, TAG+"_ONDESTROY");
        
        sendBroadcast(intentDestroyService);
		
		super.onDestroy();
	}
	
}